package com.ly.user_system.lock;

import org.redisson.api.RedissonClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration

public class LockConfig {


    @Bean
    public LockService jvmLockService(){
        return new JvmLockService();
    }


    @ConditionalOnBean(RedissonClient.class)
    @Bean
    public LockService redisLockService(RedissonClient redissonClient){
        return new RedisLockService(redissonClient);
    }


}
